import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {SetNewAccountPage} from "../set-new-account/set-new-account";
import {SetAccountPermissionPage} from "../set-account-permission/set-account-permission";
import {SetAboutPage} from "../set-about/set-about";
import {LoginPage} from "../login/login";
import {MessagePage} from "../message/message";
import {ChangePhonePage} from "../change-phone/change-phone";
import {ChangePasswordPage} from "../change-password/change-password";

/**
 * Generated class for the SettingPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-setting',
  templateUrl: 'setting.html',
})
export class SettingPage {

  language = 'c';
  information = ['主人','主人的花园','13726039296','珠海市香洲区','192.168.5.22','20160522@qq.com'];
  is_disabled = [true,true,true,true,true,true];

  constructor(public navCtrl: NavController, public navParams: NavParams) {
  }

  ionViewDidLoad() {
    this.is_disabled = [true,true,true,true,true,true];
  }

  edit_ifo(n){
    this.is_disabled[n] = !this.is_disabled[n];

  }

  goto_message(){
    this.navCtrl.push(MessagePage);
  }

  new_account(){
    this.navCtrl.push(SetNewAccountPage);
  }

  account_permission(){
    this.navCtrl.push(SetAccountPermissionPage);
  }

  about() {
    this.navCtrl.push(SetAboutPage);
  }
  goto_login(){
    this.navCtrl.push(LoginPage);
  }

  goto_changephone(){
    this.navCtrl.push(ChangePhonePage);
  }
  goto_changepassword(){
    this.navCtrl.push(ChangePasswordPage);
  }

}
